package com.neuedu.his.controller;

import com.neuedu.his.entity.User;
import com.neuedu.his.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

//@Controller
@RestController   // Controller +  @ResponseBody
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    /**
     * http://localhost:8080/ssm/user/list
     * @return
     */
//    @ResponseBody
    @RequestMapping("/list")
    public List<User> list(){

        List<User> list = userService.list();

        return list;
    }




}
